package leetcode;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
import java.util.TreeSet;

/**
 * create by duanx 2022/2/7
 *@description： todo
 *@classname: Test3
 *@author: duanx
 *@date: 2022/2/7 9:22
 **/
public class Test3 {

    public static void main(String[] args) {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        try {
            String str;
            List<TreeSet<Integer>> treeSets = new ArrayList<>();
            while (!(str = reader.readLine()).isEmpty()){
                int n = Integer.parseInt(str);
                if(n>1000||n<1){
                    break;
                }
                TreeSet<Integer> integers = new TreeSet<>();
                for (int i = 0;i<n;i++){
                    int x = Integer.parseInt(reader.readLine());
                    if(x>500||x<1){
                        break;
                    }
                    integers.add(x);
                }
                treeSets.add(integers);
            }
            for (TreeSet<Integer> treeSet :treeSets){
                for(Integer integer :treeSet){
                    System.out.println(integer);
                }
            }
        } catch (IOException e) {
            e.printStackTrace();
        }

    }


}
